import { ApiCall } from "tsrpc";
import { ReqJoinCluster, ResJoinCluster } from "../../shared/gameCluster/protocols/PtlJoinCluster";
import mgr from "../../gameServerMgr"


export async function ApiJoinCluster(call: ApiCall<ReqJoinCluster, ResJoinCluster>) {
    var err = mgr.joinCluster(call.conn, call.req.serverInfo, call.req.clusterKey);
    if (err != null) {
        call.error(err);
        call.conn.close();
        return;
    }
    call.succ({
    });
}
